10 CLS
20 KEY OFF
30 PRINT "CHECKBOOK RECONCILIATION"
40 PU$="$$####,####,####,####.##"
50 PRINT
60 PRINT "WHAT IS THE ENDING BALANCE";
70 PRINT " FROM THE STATEMENT ";
80 INPUT E$
100 Q$=E$ : GOSUB 930
120 IF Q$="N" THEN GOSUB 860 : GOTO 60
130 PRINT
140 PRINT "ENTER THE AMOUNT OF EACH DEPOSIT";
150 PRINT " NOT SHOWN ON THE STATEMENT";
160 PRINT " (ENTER ZERO WHEN ALL OUTSTANDING";
170 PRINT " DEPOSITS ARE ENTERED)"
180 D=0
190 PRINT SPC(8)
200 INPUT ;""; A$
220 IF VAL(A$)=0 THEN 330
260 IF VAL(A$)<0 THEN GOSUB 890 : GOTO 190
270 Q$=A$ : GOSUB 930
290 IF Q$="N" THEN GOSUB 890 : GOTO 190
300 D=D+VAL(A$)
310 PRINT
320 GOTO 190
330 PRINT
340 PRINT "ENTER THE AMOUNT OF EACH CHECK";
350 PRINT " NOT SHOWN ON THE STATEMENT";
360 PRINT " (ENTER ZERO WHEN ALL OUTSTANDING";
370 PRINT " CHECKS ARE ENTERED)"
380 C=0
390 PRINT SPC(18)
400 INPUT ;""; A$
420 IF VAL(A$)=0 THEN 530
460 IF VAL(A$)<0 THEN GOSUB 890 : GOTO 390
470 Q$=A$: GOSUB 930
490 IF Q$="N" THEN GOSUB 890 : GOTO 390
500 C=C+VAL(A$)
510 PRINT
520 GOTO 390
530 PRINT
540 PRINT "         ACCOUNT BALANCE =";:PRINT USING PU$; D+VAL(E$)-C
550 PRINT
560 PRINT "ENTER YOUR CHECKBOOK BALANCE ";
570 INPUT B
580 PRINT "ENTER THE AMOUNT OF SERVICE CHARGES ";
590 INPUT S$
630 IF VAL(S$)<0 THEN GOSUB 890 : GOTO 190
640 Q$=S$ : GOSUB 930
660 IF Q$="N" THEN  GOSUB 890 : GOTO 190
670 PRINT
680 PRINT "ADJUSTED ACCOUNT BALANCE =";:PRINT USING PU$; B-VAL(S$)
690 IF ABS(VAL(E$)+D-C-B+VAL(S$))<.0001 THEN 790
700 PRINT
710 PRINT "YOUR ACCOUNT IS OUT OF BALANCE.";
720 PRINT " MAKE SURE YOU HAVE INCLUDED";
730 PRINT " ALL TRANSACTIONS AGAINST THIS ACCOUNT,";
740 PRINT " INCLUDING AUTOMATIC DEPOSITS AND";
750 PRINT " INTEREST PAYMENTS, AS WELL AS";
760 PRINT " PRE-AUTHORIZED WITHDRAWALS."
770 PRINT
780 REM
790 PRINT
800 PRINT "WOULD YOU LIKE TO RE-RUN THIS PROGRAM";
810 PRINT " WITH NEW DATA (Y/N) ?"
820 Z$=INKEY$:IF Z$="" THEN 820
830 IF Z$="Y" OR Z$="y" THEN 50
840 IF Z$="N" OR Z$="n" THEN 980
850 GOTO 800
860 PRINT " ERROR: ENTER A VALID DOLLAR AMOUNT ONLY."
870 PRINT
880 RETURN
890 PRINT " ERROR: ENTER A POSITIVE VALID DOLLOR AMOUNT ONLY."
900 PRINT
910 RETURN
930 FOR K=1 TO LEN(Q$)
940 IF MID$(Q$, K, 1)<>"." THEN 960
950 IF LEN(Q$)>K+2 THEN Q$="N"
960 NEXT
970 RETURN
980 END
